//
// Created by marcin on 5/11/15.
//

#ifndef XMREG01_TOOLS_H
#define XMREG01_TOOLS_H

#include <string>

#include "monero_headers.h"
#include "electrum-words.h"
#include "cryptonote_basic/cryptonote_basic_impl.h"



/**
 * Some helper functions used in the example.
 * Names are rather self-explanatory, so I think
 * there is no reason for any detailed explanations here
 */
namespace xmreg
{
    using namespace cryptonote;
    using namespace crypto;
    using namespace std;


    template <typename T>
    bool
    parse_str_secret_key(const string& key_str, T& secret_key);

    bool
    parse_str_address(const string& address_str,
                      account_public_address& address);

    string
    print_address(const account_public_address& address);

    ostream&
    operator<< (ostream& os, const account_public_address& addr);


    ostream&
    operator<< (ostream& os, const xmreg::secret_key16& sec16);

    void
    keccak_hash(secret_key& prv, crypto::hash& result);

    template <typename T>
    T get_key_from_hash(crypto::hash& in_hash);

}

#endif //XMREG01_TOOLS_H
